package com.example.fragments;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.graphics.Point;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        /*FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

        WindowManager vm = getWindowManager();

        Display display = vm.getDefaultDisplay();

        Point size = new Point();
        display.getSize(size);

        Toast.makeText(this, size.x + ":"+ size.y, Toast.LENGTH_LONG).show();

        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);
        int height = metrics.heightPixels;
        int width  = metrics.widthPixels;

        Toast.makeText(this, width + ":"+ height, Toast.LENGTH_LONG).show();

        if(width > height){
            FirstFragment firstFragment = new FirstFragment();
            fragmentTransaction.replace(android.R.id.content, firstFragment);
        } else {
            SecondFragment secondFragment = new SecondFragment();
            fragmentTransaction.replace(android.R.id.content, secondFragment);
        }

        fragmentTransaction.commit();*/


    }
}
